package com.vcc.service.client.vo.taskLog;

import com.vcc.core.util.DateUtil;
import com.vcc.data.entity.TaskLog;
import com.vcc.service.client.vo.baseVo.BaseVo;
import lombok.*;

import java.io.Serializable;

@EqualsAndHashCode(callSuper = true)
@Setter
@Getter
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TaskLogVo extends BaseVo implements Serializable {

    private String orderId;
    private Long userId;
    private String account;
    private String requestDate;
    private Integer useFlag;
    private String remark;
    private String completionDate;
    private Integer status;
    private Integer count;
    private Integer processedSuccessCount;
    private Integer processedErrorCount;

    public TaskLogVo(TaskLog taskLog, String account) {
        super.setId(taskLog.getId());
        this.orderId = taskLog.getOrderId();
        this.userId = taskLog.getUserId();
        this.account = account;
        this.requestDate = DateUtil.format(taskLog.getRequestDate());
        this.useFlag = taskLog.getUseFlag();
        this.remark = taskLog.getRemark();
        this.completionDate = taskLog.getStatus() == 0 ? DateUtil.format(taskLog.getCompletionDate()) : "";
        this.status = taskLog.getStatus();
//        this.count = taskLog.getCount();
//        this.processedSuccessCount = taskLog.getProcessedSuccessCount();
//        this.processedErrorCount = taskLog.getProcessedErrorCount();
    }
}
